#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   __init__.py
@Time    :   2024-07-09 12:55:39
@Author  :   chakcy 
@Email   :   947105045@qq.com
@description   :   models
'''

from typing import Dict, Union, Any, List
from pydantic import BaseModel

class CommonResponseModel(BaseModel):
    """一般Response返回模型"""
    code: int
    message: str
    data: Dict[str, Union[str, Dict[str, Any], int, List[Any]]]

def create_response(data: Dict[str, Any], code: int, message: str) -> Dict[str, Any]:
    return CommonResponseModel(data=data, code=code, message=message).model_dump()